﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using HostTool.Core;

namespace HostTool.GUI
{
    public partial class FormCPUParam : Form
    {

        List<CPU> listCPU = new List<CPU>();
        public FormCPUParam()
        {
            InitializeComponent();

            HostMachine machine = MachineManager.GetMachine();


            foreach (IBoard board in machine.Boards)
            {
                if (board is BoardHost)
                {
                    foreach (ICPU cpu in board.CPUS)
                    {
                        if (cpu is HostDecodeCPU)
                        {
                            listCPU.Add(cpu as CPU);
                        }
                    }
                }
            }

            cpuParam1.CPU = listCPU[0];
            cpuParam2.CPU = listCPU[1];
            cpuParam3.CPU = listCPU[2];
            cpuParam4.CPU = listCPU[3];
        }

        protected override void OnSizeChanged(EventArgs e)
        {
            base.OnSizeChanged(e);

            int width = this.Width / 4;

            cpuParam1.Width = width;
            cpuParam2.Width = width;
            cpuParam3.Width = width;
        }
    }

    
}
